import React, { Component } from 'react'
import { Form, Input } from 'antd'
import PropTypes from 'prop-types'


export default class UpdateForm extends Component {
    static propTypes = {
        categoryName: PropTypes.string.isRequired
    }
	render() {
        const { categoryName } = this.props
		return (
			<div>
				<Form
					name='addCategory'
					layout='vertical'
					initialValues={{ categoryName }}
					ref={this.props.updateFormRef}
				>
					<Form.Item
						name='categoryName'
						label='品类名称'
						rules={[
							{ required: true, message: '请输入分类名称' },
							{ max: 10, message: '不能超过十个字' },
						]}
					>
						<Input placeholder='请输入分类名称' />
					</Form.Item>
				</Form>
			</div>
		)
	}
}
